package io.renren.modules.erp.service;

import com.baomidou.mybatisplus.extension.service.IService;
import io.renren.common.utils.PageUtils;
import io.renren.modules.erp.entity.DepotItem;
import io.renren.modules.erp.entity.OrgaUserRel;
import io.renren.modules.erp.entity.SerialNumber;
import io.renren.modules.erp.entity.SerialNumberEx;

import javax.servlet.http.HttpServletRequest;
import java.util.List;

/**
 * Description
 *
 * @Author: cjl
 * @Date: 2019/1/21 16:33
 */
public interface SerialNumberService  extends IService<SerialNumber> {

    SerialNumber getSerialNumber(long id)throws Exception ;
    List<SerialNumber> getSerialNumberListByIds(String ids)throws Exception ;

    List<SerialNumber> getSerialNumber()throws Exception ;

    PageUtils select(String serialNumber, String materialName, Integer currPage, Integer pageSize)throws Exception ;
    Long countSerialNumber(String serialNumber,String materialName)throws Exception ;

    int insertSerialNumber(String beanJson, HttpServletRequest request)throws Exception ;

    int updateSerialNumber(String beanJson, Long id, HttpServletRequest request) throws Exception;

    int deleteSerialNumber(Long id, HttpServletRequest request)throws Exception;

    int batchDeleteSerialNumber(String ids, HttpServletRequest request)throws Exception ;
    int checkIsNameExist(Long id, String serialNumber)throws Exception ;
    int batchSetEnable(Boolean enabled, String materialIDs)throws Exception;

    List<SerialNumberEx> findById(Long id)throws Exception;
    void checkIsExist(Long id, String materialName, String serialNumber) throws Exception;
    SerialNumberEx addSerialNumber(SerialNumberEx serialNumberEx,Long userId) throws Exception;
    SerialNumberEx updateSerialNumber(SerialNumberEx serialNumberEx,Long userId)throws Exception;
    Long checkMaterialName(String materialName)throws Exception;
    Long getSerialNumberMaterialIdByMaterialName(String materialName)throws Exception;
    void checkAndUpdateSerialNumber(DepotItem depotItem, Long userId) throws Exception;
    int sellSerialNumber(Long materialId, Long depotHeadId,int count,Long userId) throws Exception;
    int cancelSerialNumber(Long materialId, Long depotHeadId,int count,Long userId) throws Exception;
    void batAddSerialNumber(String materialName, String serialNumberPrefix, Integer batAddTotal, String remark,Long userId)throws Exception ;
    int batchDeleteSerialNumberByIds(String ids,Long userId) throws Exception;
}
